<!DOCTYPE html>
<html>
	<head>
		<include file="./Public/Header/header.html,./Public/Header/jquery.html,./Public/Header/mobile.html,./Public/Header/validate.html" />
		<title>员工验证</title>
	</head>
<body>
<div id="loginpage" data-role="page" data-theme="c"  data-position="fixed">
	<include file="By/mobile_header" header="员工验证"/>
	<div data-role="content">
		<form id="loginform" method="post" action="{:U('Home/By/index')}">
			<div data-role="fieldcontain">
  			<label for="code">请输入您的抽奖码:</label>
  			<input type="text" name="code" id="username"  placeholder="请输入您的抽奖码">
  			</div>
  			<input type="submit" value="点我进入抽奖" name="loginbtn" id="loginbtn" data-theme="e">
		</form>
		<p style="color: red;">公告：本次抽奖活动只有北洋员工才可参与，在每个人的号码牌上有一个抽奖码，将其输入到抽奖码输入框中，点击抽奖按钮即可参与抽奖活动，每人只可参与一次，祝您夺得大奖哦!</p>
	</div>
</div>
<script>
$('#loginpage').bind('pageinit', function(event) {
	$('#loginform').validate({
		submitHandler:function(form) {
			form.submit();
		},
		errorPlacement: function(error, element) {  
		    error.appendTo(element.parent().parent());  
		},
		onfocusout: function(element) { $(element).valid();},
		rules: {
			code: {
				required: true,
				rangelength:[6,6],
			}
		},
		messages:  {
			code: {
				required:"您还没有输入抽奖码",
				rangelength:"请输入6位抽奖码"
			}
		}	
	});
});
</script>
</body>
</html>